package com.platform.system.service.impl;

import java.util.List;

import com.platform.common.annotation.DataScope;
import com.platform.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.platform.system.mapper.ProContentMapper;
import com.platform.system.domain.ProContent;
import com.platform.system.service.IProContentService;

/**
 * 订单评论Service业务层处理
 *
 * @author platform
 * @date 2025-02-23
 */
@Service
public class ProContentServiceImpl implements IProContentService {
    @Autowired
    private ProContentMapper proContentMapper;

    /**
     * 查询订单评论
     *
     * @param id 订单评论主键
     * @return 订单评论
     */
    @Override
    public ProContent selectProContentById(Long id) {
        return proContentMapper.selectProContentById(id);
    }

    /**
     * 查询订单评论列表
     *
     * @param proContent 订单评论
     * @return 订单评论
     */
    @Override
    @DataScope(deptAlias = "d", userAlias = "u")
    public List<ProContent> selectProContentList(ProContent proContent) {
        return proContentMapper.selectProContentList(proContent);
    }

    /**
     * 查询订单评论列表
     *
     * @param proContent 订单评论
     * @return 订单评论
     */
    @Override
    public List<ProContent> selectProContentListByProducproId(ProContent proContent) {
        return proContentMapper.selectProContentListByProducproId(proContent);
    }

    /**
     * 新增订单评论
     *
     * @param proContent 订单评论
     * @return 结果
     */
    @Override
    public int insertProContent(ProContent proContent) {
        proContent.setCreateTime(DateUtils.getNowDate());
        return proContentMapper.insertProContent(proContent);
    }

    /**
     * 修改订单评论
     *
     * @param proContent 订单评论
     * @return 结果
     */
    @Override
    public int updateProContent(ProContent proContent) {
        proContent.setUpdateTime(DateUtils.getNowDate());
        return proContentMapper.updateProContent(proContent);
    }

    /**
     * 批量删除订单评论
     *
     * @param ids 需要删除的订单评论主键
     * @return 结果
     */
    @Override
    public int deleteProContentByIds(Long[] ids) {
        return proContentMapper.deleteProContentByIds(ids);
    }

    /**
     * 删除订单评论信息
     *
     * @param id 订单评论主键
     * @return 结果
     */
    @Override
    public int deleteProContentById(Long id) {
        return proContentMapper.deleteProContentById(id);
    }
}
